<?php

/**
 * Manage data of "testimonial" table
 * 
 * @author Tuan
 */
Class Testimonial {

    const STATUS_PENDING = 0;
    const STATUS_APPROVE = 1;

    public static function getRecord($limit) {
	global $wpdb;
	$aResult = $wpdb->get_results('SELECT * FROM `travel_testimonial_basics` WHERE `tb_approved` = ' . self::STATUS_APPROVE . ' ORDER BY `tb_id` LIMIT ' . $limit);
	return $aResult;
    }
	public static function AllgetRecord() {
			global $wpdb;
			$aResult = $wpdb->get_results('SELECT * FROM `travel_testimonial_basics` WHERE `tb_approved` = ' . self::STATUS_APPROVE.' ORDER BY `tb_id` DESC ' );
			return $aResult;
    }
	
	/*
	author:Tham
	description: get iteme of Testimonial by id_testimonial
	@param: $id_testimonial
	@return : $ds_testimonal
	*/
	public static function ListTestimonialByID($id_testimonial)
	{
		     global $wpdb;
			 $ds_testimonal =  $wpdb->get_results('SELECT * FROM `travel_testimonial_basics` WHERE `tb_id` = '.$id_testimonial );
		     return $ds_testimonal;
	}

}
